$OpenBSD: patch-linc2_src_linc-connection_c,v 1.1 2013/05/14 12:44:41 ajacoutot Exp $

From 26371ccfe0728b8bdd3f8ae3109d22645e385525 Mon Sep 17 00:00:00 2001
From: Kjartan Maraas <kmaraas@gnome.org>
Date: Tue, 14 May 2013 11:53:52 +0000
Subject: Commit patch from bug #662623 to fix connection failures on heavily loaded systems. Patch from Red Hat support.

--- linc2/src/linc-connection.c.orig	Tue Feb  9 13:05:35 2010
+++ linc2/src/linc-connection.c	Tue May 14 14:40:34 2013
@@ -651,8 +651,12 @@ link_connection_do_initiate (LinkConnection        *cn
 		fix_permissions (service);
 	}
 #endif
-
+retry:
 	LINK_TEMP_FAILURE_RETRY_SOCKET (connect (fd, saddr, saddr_len), rv);
+	if (rv == -1L && errno == EAGAIN) {
+		g_usleep (10000);
+		goto retry;
+	}
 #ifdef HAVE_WINSOCK2_H
 	if (rv == SOCKET_ERROR) {
 		if ((options & LINK_CONNECTION_NONBLOCKING) &&
